package YuanFuDao;

import domain.ListNode;

/**
 * 输入: 1->1->2->3->3
 * 输出: 1->2->3
 * @author: leiwenkang
 * @date: 2020/5/31
 * @time: 14:12
 */
public class Test02移除重复节点 {
    public static void main(String[] args) {


    }

    public static void removeDupNode(ListNode head) {
        if (head == null || head.next == null) {
            return;
        }
        ListNode p = head;
        while (p.next != null) {
            if (p.next.val == p.val) {
                p.next = p.next.next;
            } else {
                p = p.next;
            }
        }
    }
}
